package org.jwebuilder.xom;

import javax.xml.stream.XMLInputFactory;

import org.xml.sax.XMLReader;

import nu.xom.Builder;
import nux.xom.io.StaxUtil;
import nux.xom.pool.BuilderFactory;

public class XmlPageTemplateBuilderFactory extends BuilderFactory
{
	@Override
	protected Builder newBuilder(XMLReader parser, boolean validate)
	{
		XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
		xmlInputFactory.setProperty("javax.xml.stream.isValidating", false);
		xmlInputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", false);
		xmlInputFactory.setProperty("javax.xml.stream.supportDTD", false);
		return StaxUtil.createBuilder(xmlInputFactory, new XmlPageTemplateNodeFactory());
	}
}